/*
public class test {
    public static void main(String[] args) {
        System.out.println("Hello World");
    }
}
*/

/*
public class test {
    public static void main(String[] args) {
        System.out.println(10);
    }
}*/

/*
public class test {
    public static void main(String[] args) {
        int i = 1;
        while(i <= 100) {
            if(i % 15 != 0) {
                i++;
                continue;
            }S
            System.out.print(i + " ");
            i++;
        }
    }
}
*/

//1-100中数字9的个数
/*
public class test {
    public static void main(String[] args) {
        int i = 1, count = 0, ret = 0;
        while(i <= 100) {
            ret = i;
            while(ret > 0) {
                if (ret % 10 == 9) {
                    count++;
                }
                ret /= 10;
            }
            i++;
        }
        System.out.println(count);
    }
}*/


/*import java.util.Scanner;

//判断素数
public class test {
    public static void main(String[] args) {
        int i = 2;
        double limit;
        boolean flg = false;
        Scanner num = new Scanner(System.in);
        int n = num.nextInt();
        limit = Math.sqrt(n) + 1;
        if(n <= 1) {
            flg = false;
        } else if(n == 2) {
            flg = true;
        }
        for(i = 2; i <= limit; i++) {
            if(n % i == 0) {
                break;
            }
            if(i > limit) {
                flg = true;
            } else {
                flg = false;
            }
        }
        if(flg == true) {
            System.out.println("Yes");
        } else {
            System.out.println("No");
        }
    }
}*/


/*import java.util.Scanner;

//统计水仙花数
public class test {
    public static void main(String[] args) {
        int count = 0, t = 0, sum = 0;
        Scanner num = new Scanner(System.in);
        int n = num.nextInt();
        for(int i = 0; i <= n; i++) {
            count = 0;
            t = i;
            while(t != 0) {
                count++;
                t /= 10;
            }
            t = i;
            while(t != 0) {
                sum += Math.pow(t % 10, count);
                t /= 10;
            }
            if(sum == i) {
                System.out.println(i);
            }
            sum = 0;
        }
    }
}*/


//统计分数
/*
public class test {
    public static void main(String[] args) {
        int i = 1;
        double sum = 0, ret = 0;
        for(i = 1; i <= 100; i++) {
            ret = 1.0 / i;
            if(i % 2 == 0) {
                sum += -ret;
            } else {
                sum += ret;
            }
        }
        System.out.println(sum);
    }
}*/

//最大公约数
/*
import java.util.Scanner;

public class test {
    public static void main(String[] args) {
        Scanner num = new Scanner(System.in);
        int a = num.nextInt();
        int b = num.nextInt();
        int ret = 0, c = 0;
        while (true) {
            if (a % 2 == 0 && b % 2 == 0) {
                a /= 2;
                b /= 2;
            } else {
                c = a;
                a = b;
                b = c - b;
            }
            if (a <= b) {
                ret = b;
                break;
            }
        }
        System.out.println(ret);
    }
    }*/

/*import java.util.Scanner;

//法2：辗转相除法
public class test {
    public static void main(String[] args) {
        Scanner num = new Scanner(System.in);
        int a = num.nextInt();
        int b = num.nextInt();
        int c = a % b;
        while(c != 0) {
            a = b;
            b = c;
            c = a % b;
        }
        System.out.println(b);
    }
}*/


/*import java.util.Scanner;

//统计一个二进制整数中1的个数
public class test {
    public static void main(String[] args) {
        Scanner num = new Scanner(System.in);
        int n = num.nextInt();
        int count = 0;
        for(int i = 0; i < 32; i++) {
            if((n & 1) == 1) {
                count++;
            }
            n  = n >>> 1;
        }
        System.out.println(count);
    }
}*/

/*
import java.util.Scanner;

//法2：n & (n - 1)
public class test {
    public static void main(String[] args) {
        Scanner num = new Scanner(System.in);
        int n = num.nextInt();
        int count = 0;
        while(n != 0) {
            n = n & (n - 1);
            count++;
        }
        System.out.println("1的个数为" + count);
    }
}*/


/*
public class test {
    public static int add(int n) {
        int sum = 0;
        if(n == 0) {
            return 0;
        }
        return  n + add(n - 1);
    }
    public static void main(String[] args) {
        System.out.println(add(10));

    }
}*/

//递推求各位和
/*
public class test {
    public static int sum(int n) {
        if(n / 10 == 0) {
            return n;
        }
        return (n % 10) + sum(n / 10);
    }
    public static void main(String[] args) {
        System.out.println(sum(1729));
    }
}*/


/*
import java.util.Scanner;

//使用函数求最大值
public class test {
    public static int max2(int a, int b) {
        int ret1 = 0;
        if(a < b) {
            ret1 = b;
        } else {
            ret1 = a;
        }
        return ret1;
    }

    public static int max3(int a, int b, int c) {
        int r1 = max2(a, b);
        int r2 = max2(r1, c);
        return r2;
    }
    public static void main(String[] args) {
        Scanner num = new Scanner(System.in);
        int a = num.nextInt();
        int b = num.nextInt();
        int c = num.nextInt();
        int ret = max3(a, b, c);
        System.out.println(ret);
    }
}*/


/*
import java.util.Scanner;

//和的重载
public class test {
    public static int sum(int a, int b) {
        int sum = a + b;
        return sum;
    }
    public static double sum(double a, double b, double c) {
        double sum = a + b + c;
        return sum;
    }

    public static void main(String[] args) {
        Scanner num = new Scanner(System.in);
        System.out.println("请输入你想计算的两个整数：");
        int a = num.nextInt();
        int b = num.nextInt();
        System.out.println("请输入你想计算的三个小数：");
        double m = num.nextDouble();
        double n = num.nextDouble();
        double t = num.nextDouble();
        int ret1 = sum(a, b);
        double ret2 = sum(m, n , t);
        System.out.println("整数和为：" + ret1);
        System.out.println("小数和为：" + ret2);
    }
}*/


/*
import java.util.Scanner;

//求最大值的重载
public class test {
    public static int max(int a, int b) {
        int ret = 0;
        if(a < b) {
            ret = b;
        } else {
            ret = a;
        }
        return ret;
    }
    public static double max(double a, double b) {
        double ret = 0;
        if(a < b) {
            ret = b;
        } else {
            ret = a;
        }
        return ret;
    }
    public static double max(double a, double b, double c) {
        double r1 = max(a, b);
        double r2 = max(r1, c);
        return r2;
    }

    public static void main(String[] args) {
        Scanner num = new Scanner(System.in);
        System.out.println("请输入你想求出最大值的两个整数:");
        int a = num.nextInt();
        int b = num.nextInt();
        System.out.println("请输入你想求出最大值的三个小数:");
        double m = num.nextDouble();
        double n = num.nextDouble();
        double t = num.nextDouble();
        int ret1 = max(a, b);
        double ret2 = max(m, n, t);
        System.out.println("最大的整数为：" + ret1);
        System.out.println("最大的小数为：" + ret2);
    }
}*/


/*
import java.util.Scanner;

//递归求解汉诺塔问题
public class test {
    public static void print(char a, char b) {
        System.out.println(a + "-->" + b);
    }
    public static void move(int n, char start, char tempt, char end) {
        if(n == 1) {
            print(start, end);
        } else {
            move(n-1, start, end, tempt);
            print(start, end);
            move(n-1, tempt, start, end);
        }
    }
    public static void main(String[] args) {
        Scanner num = new Scanner(System.in);
        int n = num.nextInt();
        char A = 'A', B = 'B', C = 'C';
        move(n, A, B, C);
    }
}*/



//自己使用一个方法实现Arrays.toString功能
/*
public class test {
    public static String myToString(int[] array) {
        String ret = "[";
        for(int i = 0; i < array.length; i++) {
            ret += array[i];
            if(array[i] != array.length) {
                ret += ", ";
            }
        }
        ret += "]";
        return ret;
    }
    public static void main(String[] args) {
        int[] array = {1, 2, 3, 4, 5};
        System.out.println(myToString(array));
    }
}*/


/*
import java.util.Arrays;

//改变原有数组元素的值
public class test {
    public static int[] transform(int[] array) {
        for(int i = 0; i < 3; i++) {
            array[i] = 2 * array[i];
        }
        return array;
    }
    public static void main(String[] args) {
        int[] arr = {1, 2, 3};
        System.out.println(Arrays.toString(arr));
        transform(arr);
        System.out.println(Arrays.toString(arr)
        );
    }
}*/


/*
import java.util.Arrays;
import java.util.Scanner;

//奇数位于偶数之前
public class test {
    public static int[] sort(int[] array) {
        for(int i = 0; i < array.length-1; i++) {
            for(int j = 0; j < array.length-1; j++) {
            if(array[j] % 2 == 0 && array[j+1] % 2 != 0) {
                int t = array[j];
                array[j] = array[j + 1];
                array[j + 1] = t;
            }
            }
        }
        return array;
    }
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        System.out.println("请输入数组元素个数：");
        int n = scan.nextInt();
        int[] array = new int[n];
        System.out.println("请输入数组：");
        for(int i = 0; i < n; i++) {
            array[i] = scan.nextInt();
        }
        sort(array);
        System.out.println(Arrays.toString(array));
    }
}*/

/*mport java.util.Arrays;

//法二
public class test {
    public static void func(int[] array) {
        int left = 0;
        int right = array.length-1;
        while(left < right) {
            while(left < right && array[left] % 2 != 0) {
                left++;
            }
            while(left < right && array[right] % 2 == 0) {
                right--;
            }
            swap(array, left, right);
        }
    }

    public static int[] swap(int[] array, int i, int j) {
        int tmp = array[i];
        array[i] = array[j];
        array[j] = tmp;
        return array;
    }
    public static void main(String[] args) {
    int[] array = {1, 2, 3 ,4 ,5 ,6 ,7 ,8, 9};
        func(array);
        System.out.println(Arrays.toString(array));
    }
}*/



/*import java.util.Scanner;

//二分查找
public class test {
    public static int binarySearch(int[] array, int key) {
        int left = 0;
        int right = array.length-1;
        while(left <= right) {
            int mid = (left + right) / 2;
            if(array[mid] == key) {
                return mid;
            } else if(array[mid] < key) {
                left = mid + 1;
            } else if(array[mid] > key){
                right = mid - 1;
            }
        }
        return -1;
    }

    public static void main(String[] args) {
        int[] array= {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
        int key = 0;
        System.out.println("请输入你要查找的数字:");
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int ret = binarySearch(array, n);
        System.out.println("所要查找的数字的下标为：" + ret);
    }
}*/


/*import java.util.Arrays;
import java.util.Scanner;

//冒泡排序
public class test {
    public static int[] bubbleSort(int[] array) {
        for(int i = 0; i < array.length; i++) {
            boolean flg = false;
            for(int j = 0; j < array.length-i; j++) {
                if(array[j] > array[j+1]) {
                    int t = array[j+1];
                    array[j+1] = array[j];
                    array[j] = t;
                    flg = true;
                }
            }
            if(flg == false) {
                return array;
            }
        }
        return array;
    }

    public static void main(String[] args) {
        System.out.println("请输入数组元素个数：");
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int[] array = new int[n];
        System.out.println("请输入你的数组：");
        for(int i = 0; i < n; i++) {
            array[i] = scan.nextInt();
        }
        bubbleSort(array);
        System.out.println(Arrays.toString(array));
    }
}*/


/*
import java.util.Scanner;
import java.util.Arrays;

//两数之和
public  class test{
    public static int[] targetArray(int[] array, int target) {
        int[] ret = new int[2];
        for (int i = 0; i < array.length; i++) {
            for (int j = 0; j < array.length; j++) {
                if (array[i] + array[j] == target && i != j) {
                    ret[0] = i;
                    ret[1] = j;
                }
            }
        }
        return ret;
    }

    public static void main(String[] args) {
        System.out.println("请输入数组元素个数：");
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int[] array = new int[n];
        System.out.println("请输入数组：");
        for(int i = 0; i < n; i++) {
            array[i] = scan.nextInt();
        }
        System.out.println("请输入你的目标：");
        int target = scan.nextInt();
        System.out.println(Arrays.toString(targetArray(array, target)));
    }
}*/


/*import java.util.Scanner;

//统计只出现一次的数字
public class test {
    public static int count(int[] array) {
        int ret = 0;
        boolean flg = false;
        for(int i = 0; i < array.length; i++) {
            flg = false;
            for(int j = 0; j < array.length; j++) {
                if(array[j] == array[i] && i != j) {
                    flg = true;
                    break;
                }
            }
            if(flg == false) {
                ret = array[i];
            }
        }
        return ret;
    }

    public static void main(String[] args) {
        System.out.println("请输入数组中的元素个数：");
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int[] array = new int[n];
        System.out.println("请输入数组：");
        for(int i = 0; i < array.length; i++) {
            array[i] = scan.nextInt();
        }
        int ret = count(array);
        System.out.println(ret);
    }
}*/

//法2：使用异或进行求解统计出现一次的次数
/*public class test {
    public static int func(int[] array) {
        int ret = 0;
        for(int i = 0; i < array.length; i++) {
            ret ^= array[i];
        }
        return ret;
    }

    public static void main(String[] args) {
        int[] array = {4, 4, 2, 5, 5};
        int ret = func(array);
        System.out.println(ret);
    }
}*/



/*
import java.util.Scanner;

//多数元素
public class test {
    public static int count(int[] array) {
        int count = 0;
        int ret = 0;
        for(int i = 0; i < array.length; i++) {
            count = 0;
            for(int j = 0; j < array.length; j++) {
                if(array[i] == array[j] && i != j) {
                    count++;
                }
            }
            if(count > 2/array.length) {
             ret =  array[i];
             break;
            }
        }
        return ret;
    }

    public static void main(String[] args) {
        System.out.println("请输入数组元素个数：");
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int[] array = new int[n];
        System.out.println("请输入数组：");
        for (int i = 0; i < n; i++) {
            array[i] = scan.nextInt();
        }
        int ret = count(array);
        System.out.println(ret);
    }
}*/

/*import java.util.Arrays;

//法2:
public class test {
    public static int func(int[] array) {
        Arrays.sort(array);
        return array[array.length/2];
    }
    public static void main(String[] args) {
        int[] array = {2, 2, 3, 2, 1, 1, 3};
        System.out.println(func(array));
    }
}*/



/*
import java.util.Scanner;
//存在连续三个的奇数
public class test {
    public static boolean func(int[] array) {
        int count = 0;
        boolean ret = false;
        for(int i = 0; i <= array.length-3; i++) {
            for(int j = i+1; j < i+3; j++) {
                if(array[j] % 2 != 0) {
                    count++;
                }
            }
            if(count == 3) {
                ret = true;
                break;
            }
        }
        return ret;
    }

    public static void main(String[] args) {
        System.out.println("请输入数组元素个数：");
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int[] array = new int[n];
        System.out.println("请输入数组：");
        for (int i = 0; i < n; i++) {
            array[i] = scan.nextInt();
        }
        boolean ret = func(array);
        System.out.println(ret);
    }
}*/

//法2：计数器
/*public class test {
    public static boolean func(int[] array) {
        int count = 0;
        for(int i = 0; i < array.length; i++) {
            if(array[i] % 2 != 0) {
                count++;
                if(count == 3) {
                    return true;
                }
            } else {
                count = 0;
            }
        }
        return false;
    }
    public static void main(String[] args) {
        int[] array = {1, 5, 3, 6, 8, 10};
        boolean ret = func(array);
        System.out.println(ret);
    }
}*/


//将大写字母变成小写字母


/*import java.util.Locale;
import java.util.Scanner;

public class test {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        String s = scan.next();
        System.out.println(s.toLowerCase());
    }
}*/



